package cn.com.gridinfo.sooc.core.my.setting.activity;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import cn.com.gridinfo.sooc.R;
import cn.com.gridinfo.sooc.base.BaseSoocActivity;

/**
 * 关于软件
 * Created by 刘晓晨 on 2015/12/15.
 */
public class AboutAppActivity extends BaseSoocActivity {
    @InjectView(R.id.about_us_version)// 版本号
            TextView aboutUsVersion;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_setting_aboutapp);
        ButterKnife.inject(this);
        PackageInfo info = null;
        try {
            info = getPackageManager().getPackageInfo(getApplication().getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {

            e.printStackTrace();
        }
        String version = info.versionName;
        aboutUsVersion.setText("V" + version);

    }

    //设置标题
    @Override
    public String setupToolBarTitle() {
        return "关于软件";
    }

    //设置左边按钮
    @Override
    public boolean setupToolBarLeftButton(ImageView leftButton) {
        return true;
    }

    //返回
    @OnClick(R.id.toolbar_leftbtn)
    void onGoBack() {
        finish();

    }
}
